<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition template="/template/main_template.xhtml" 
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:pe="http://primefaces.org/ui/extensions"
	xmlns:sec="http://www.springframework.org/security/tags">
	
<ui:define name="title">
Project Setup
</ui:define>

<ui:define name="content">	

<p:panel id="panel" header="Property Unit Details" style="width:95%">  
    
<p:focus context="panel"/> 
      
<h:form>  
	<h:panelGrid columns="4" style="width:100%;text-align:left;">
		<p:outputLabel value="Project Name"/>
		<h:inputText value="#{projectSetup.project.projectName}" style="width:250px" disabled="true"/>	
		<p:outputLabel value="Status" for="status"/>
		<p:selectOneMenu id="status" value="#{projectSetup.inventory.propertyStatus}" disabled="true"> 
			<f:selectItems value="#{projectSetup.propertyStatusList}"/>
		</p:selectOneMenu>

		<p:outputLabel value="Block No" for="blockNo"/>
		<p:inputText id="blockNo" value="#{projectSetup.inventory.blockNo}"  maxlength="8" autocomplete="off" required="true"/>
		<p:outputLabel value="Level" for="level"/>
		<p:inputText id="level" value="#{projectSetup.inventory.level}"  maxlength="5" autocomplete="off" required="true"/>

		<p:outputLabel value="Unit No" for="unitNo"/>
		<p:inputText id="unitNo" value="#{projectSetup.inventory.unitNo}"  maxlength="12" autocomplete="off" required="true"/>
		<p:outputLabel value="Layout Type" for="type"/>
		<p:inputText id="type" value="#{projectSetup.inventory.layoutType}"  maxlength="5" autocomplete="off"/>

		<p:outputLabel value="Build Up Area" for="buildUpArea"/>
		<p:inputText id="buildUpArea" value="#{projectSetup.inventory.builtUpArea}" maxlength="10" autocomplete="off" required="true">
				<f:convertNumber maxFractionDigits="0" />
                <p:ajax update="sellingPrice" event="blur" process="sellingPrice"/>
		</p:inputText>
		<p:outputLabel value="Land Area" for="landArea"/>
		<pe:inputNumber id="landArea" value="#{projectSetup.inventory.landArea}" decimalPlaces="0" autocomplete="off">
                <p:ajax update="sellingPrice" event="blur" process="sellingPrice"/>
		</pe:inputNumber>
		
		<p:outputLabel value="Selling Price" for="sellingPrice"/>
		<pe:inputNumber id="sellingPrice" value="#{projectSetup.inventory.purchasePrice}" maxValue="999999999.99" emptyValue="0" decimalPlaces="2" autocomplete="off" required="true">
		 		<p:ajax update="discountAmt" event="blur" process="sellingPrice"/>
                <p:ajax update="nettAmt" event="blur" process="sellingPrice"/>
		</pe:inputNumber>
		<p:outputLabel value="Orientation" for="orientation"/>
		<p:selectOneMenu id="orientation" value="#{projectSetup.inventory.orientation}"> 
			<f:selectItems value="#{projectSetup.orientationList}" />
		</p:selectOneMenu>


		<p:outputLabel value="Discount Amount" for="discountAmt"/>
		<pe:inputNumber id="discountAmt" value="#{projectSetup.inventory.discountAmount}" maxValue="999999999.99" emptyValue="0" decimalPlaces="2" autocomplete="off">
                <p:ajax update="nettAmt" event="blur" process="discountAmt"/>
		</pe:inputNumber>
		<p:outputLabel value="Nett Amount" for="nettAmt"/>
		<pe:inputNumber id="nettAmt" value="#{projectSetup.inventory.nettPrice}" maxValue="999999999.99" emptyValue="0" decimalPlaces="2" maxlength="12" autocomplete="off" />
		
		<!-- 
		<p:outputLabel value="Redemption Amount" for="redemptionAmt"/>
		<p:inputText  id="redemptionAmt" value="#{projectSetup.inventory.redemptionAmount}"  maxlength="10" autocomplete="off">
				<f:convertNumber maxFractionDigits="2" minFractionDigits="2"/>
                <p:ajax update="discountAmt" event="blur" process="discountAmt"/>
		</p:inputText>
				

		<p:outputLabel value="HSD No" for="hsdNo"/>
		<p:inputText id="hsdNo" value="#{projectSetup.inventory.hsdNo}" maxlength="8" autocomplete="off"/>
		<p:outputLabel value="PT No" for="ptNo"/>
		<p:inputText id="ptNo" value="#{projectSetup.inventory.ptNo}"  maxlength="8" autocomplete="off"/>


		<p:outputLabel value="Quit Rent" for="quitRent"/>
		<p:inputText id="quitRent" value="#{projectSetup.inventory.quitRent}"  maxlength="10" autocomplete="off"/>
		<p:outputLabel value="Assessment Fee" for="assFee" />
		<p:inputText id="assFee" value="#{projectSetup.inventory.assessment}" maxlength="10" autocomplete="off">
				<f:convertNumber maxFractionDigits="2" minFractionDigits="2"/>
                <p:ajax update="discountAmt" event="blur" process="discountAmt"/>
		</p:inputText>


		<p:outputLabel value="SPA Legal Fee" for="legalFee"/>
		<p:inputText id="legalFee" value="#{projectSetup.inventory.legalFee}"  maxlength="10" autocomplete="off">
				<f:convertNumber maxFractionDigits="2" minFractionDigits="2"/>
                <p:ajax update="discountAmt" event="blur" process="discountAmt"/>
		</p:inputText>
		<p:outputLabel value="Disbursement Fee" for="disbFee"/>
		<p:inputText id="disbFee" value="#{projectSetup.inventory.disbursementFee}"  maxlength="10" autocomplete="off">
				<f:convertNumber maxFractionDigits="2" minFractionDigits="2"/>
                <p:ajax update="discountAmt" event="blur" process="discountAmt"/>
		</p:inputText>


		<p:outputLabel value="Title Type" for="titleType"/>
		<p:selectOneMenu id="titleType" value="#{projectSetup.inventory.propertyTitleType}"> 
			<f:selectItems value="#{projectSetup.titleTypeList}" />
		</p:selectOneMenu>
		<p:outputLabel value="Strata Title Date" for="strataDate"/>
		<p:calendar id="strataDate" value="#{projectSetup.inventory.strataTitleObtainedDate}" pattern="dd/MM/yyyy"/>
		
		
		<p:outputLabel value="Handover Date" for="handoverDate"/>
		<p:calendar id="handoverDate" value="#{projectSetup.inventory.keyHandoverDate}" pattern="dd/MM/yyyy"/>
		<p:outputLabel value="DMC Date" for="dncDate"/>
		<p:calendar id="dncDate" value="#{projectSetup.inventory.dncDate}" pattern="dd/MM/yyyy"/>
	
	
		<p:outputLabel value="Address Line 1"/>
		<p:inputText value="#{projectSetup.inventory.propertyAddress}" />
		<p:outputLabel value="Address Line 2"/>
		<p:inputText />
	

		<p:outputLabel value="Address Line 3"/>
		<p:inputText />
		<p:outputLabel value=""/>
		<p:outputLabel value=""/>
		 -->
	</h:panelGrid>
	
	<br/>
		<p:commandButton value="Back" action="#{projectSetup.toInventoryList}" ajax="false" immediate="true" icon="ui-icon-arrowreturn-1-w"/>  &nbsp;&nbsp;
		<p:commandButton value="Save" action="#{projectSetup.saveInventory}" ajax="false" icon="ui-icon-disk" /> &nbsp;&nbsp;&nbsp;&nbsp;
		<p:commandButton value="Next" action="#{projectSetup.saveInventoryAsNew}" ajax="false" icon="ui-icon-plus"/>
</h:form> 

</p:panel>


</ui:define>

</ui:composition>